package org.bdware.bdoa.authentication;


//用于统一管理JWT相关的参数配置，兼容HMAC和RSA两种token

import org.bdware.bdoa.authentication.utils.JwxUtils;

/**
 * · iss 代表生成token的实体，一般就是认证服务器
 *
 * · iat 创建JWT的时间戳(in seconds since Epoch)
 *
 * · sub 包含用户的身份信息
 *
 * · exp token的过期时间戳
 */
public class JwtConfig {
    private String tokenName = JwxUtils.DEFAULT_TOKEN_NAME;

    // HMAC 密钥，用于支持 HMAC 算法
    private String hmacKey;

    // RSA 密钥，用于支持 RSA 算法，这里用JWK格式的密钥进行存储
    private String rsaKey;

    // JWT 标准信息：签发人 - iss
    private String issuer;

    // JWT 标准信息：主题 - sub
    private String subject;

    // JWT 标准信息：受众 - aud
    private String audience;

    // JWT 标准信息：生效时间 - nbf，未来多长时间内生效
    private long notBeforeIn;

    // JWT 标准信息：生效时间 - nbf，具体哪个时间生效
    private long notBeforeAt;

    // JWT 标准信息：过期时间 - exp，未来多长时间内过期
    private long expiredIn;

    // JWT 标准信息：过期时间 - exp，具体哪个时间过期
    private long expiredAt;

    //JWT 自定义信息，用户doi
    private String doi;

    //未加密字段信息
    private String source;

    public String getTokenName() {
        return tokenName;
    }

    public void setTokenName(String tokenName) {
        this.tokenName = tokenName;
    }

    public String getHmacKey() {
        return hmacKey;
    }

    public void setHmacKey(String hmacKey) {
        this.hmacKey = hmacKey;
    }

    public String getRsaKey() {
        return rsaKey;
    }

    public void setRsaKey(String rsaKey) {
        this.rsaKey = rsaKey;
    }

    public String getIssuer() {
        return issuer;
    }

    public void setIssuer(String issuer) {
        this.issuer = issuer;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getAudience() {
        return audience;
    }

    public void setAudience(String audience) {
        this.audience = audience;
    }

    public long getNotBeforeIn() {
        return notBeforeIn;
    }

    public void setNotBeforeIn(long notBeforeIn) {
        this.notBeforeIn = notBeforeIn;
    }

    public long getNotBeforeAt() {
        return notBeforeAt;
    }

    public void setNotBeforeAt(long notBeforeAt) {
        this.notBeforeAt = notBeforeAt;
    }

    public long getExpiredIn() {
        return expiredIn;
    }

    public void setExpiredIn(long expiredIn) {
        this.expiredIn = expiredIn;
    }

    public long getExpiredAt() {
        return expiredAt;
    }

    public void setExpiredAt(long expiredAt) {
        this.expiredAt = expiredAt;
    }

    public String getDoi() {
        return doi;
    }

    public void setDoi(String doi) {
        this.doi = doi;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }
}
